package com.cevent.yameng.web.mall.storage.controller;

import java.util.Arrays;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import com.cevent.yameng.web.mall.storage.entity.InventoryOrderTaskDetailEntity;
import com.cevent.yameng.web.mall.storage.service.InventoryOrderTaskDetailService;
import com.cevent.common.utils.PageUtils;
import com.cevent.common.utils.R;



/**
 * 库存订单详情单
 *
 * @author cevent
 * @email 1540001771@qq.com
 * @date 2020-09-14 14:18:52
 */
@RestController
@RequestMapping("storage/inventoryordertaskdetail")
public class InventoryOrderTaskDetailController {
    @Autowired
    private InventoryOrderTaskDetailService inventoryOrderTaskDetailService;

    /**
     * 列表
     */
    @RequestMapping("/list")
    //@RequiresPermissions("storage:inventoryordertaskdetail:list")
    public R list(@RequestParam Map<String, Object> params){
        PageUtils page = inventoryOrderTaskDetailService.queryPage(params);

        return R.ok().put("page", page);
    }


    /**
     * 信息
     */
    @RequestMapping("/info/{id}")
    //@RequiresPermissions("storage:inventoryordertaskdetail:info")
    public R info(@PathVariable("id") Long id){
		InventoryOrderTaskDetailEntity inventoryOrderTaskDetail = inventoryOrderTaskDetailService.getById(id);

        return R.ok().put("inventoryOrderTaskDetail", inventoryOrderTaskDetail);
    }

    /**
     * 保存
     */
    @RequestMapping("/save")
    //@RequiresPermissions("storage:inventoryordertaskdetail:save")
    public R save(@RequestBody InventoryOrderTaskDetailEntity inventoryOrderTaskDetail){
		inventoryOrderTaskDetailService.save(inventoryOrderTaskDetail);

        return R.ok();
    }

    /**
     * 修改
     */
    @RequestMapping("/update")
    //@RequiresPermissions("storage:inventoryordertaskdetail:update")
    public R update(@RequestBody InventoryOrderTaskDetailEntity inventoryOrderTaskDetail){
		inventoryOrderTaskDetailService.updateById(inventoryOrderTaskDetail);

        return R.ok();
    }

    /**
     * 删除
     */
    @RequestMapping("/delete")
    //@RequiresPermissions("storage:inventoryordertaskdetail:delete")
    public R delete(@RequestBody Long[] ids){
		inventoryOrderTaskDetailService.removeByIds(Arrays.asList(ids));

        return R.ok();
    }

}
